﻿using System;
using System.Collections.Generic;
using NETWORKLIST;

namespace BSonPosh.Network
{
	public class NetworkInfo
	{
		private INetwork _network;
		public NetworkInfo(INetwork network)
		{
			_network = network;
		}

		public string Name { get { return _network.GetName(); } }
		public string Description { get { return _network.GetDescription(); } }
		public Guid NetworkId { get { return _network.GetNetworkId(); } }
		public DomainType Domain { get { return (DomainType)_network.GetDomainType(); } }
		public NetworkCategory Category { get { return (NetworkCategory)_network.GetCategory(); } }
		public Connectivity Connectivity { get { return (Connectivity)_network.GetConnectivity(); } }
		public ConnectionInfo[] Connections
		{
			get
			{
				var output = new List<ConnectionInfo>();
				IEnumNetworkConnections connections = _network.GetNetworkConnections();
				foreach (INetworkConnection connection in connections)
				{
					output.Add(new ConnectionInfo(connection));
				}
				return output.ToArray();
			}
		}
	}
}